FROM java:openjdk-8-jdk

RUN echo "Asia/Shanghai" > /etc/timezone;dpkg-reconfigure -f noninteractive tzdata

RUN apt-get update

RUN apt-get install net-tools

RUN apt-get install -y vim

RUN apt-get install -y unzip

RUN apt-get install -y ant

RUN apt-get install -y telnet

VOLUME /data

ADD apache-tomcat-7.0.72.zip /app/

RUN unzip /app/apache-tomcat-7.0.72.zip -d /app/ && rm -rf /app/apache-tomcat-7.0.72.zip

RUN mv /app/apache-tomcat-7.0.72 /app/apache-tomcat

ADD dubbo-admin /app/dubbo-admin

RUN rm /app/apache-tomcat/webapps/ROOT/* -rf

RUN cp -r /app/dubbo-admin/* /app/apache-tomcat/webapps/ROOT/ 

ADD start.sh /app/

ADD run.sh /app/

RUN chmod +x /app/start.sh

RUN chmod +x /app/run.sh

RUN chmod +x /app/apache-tomcat/bin/*.sh

WORKDIR /app/

RUN groupadd  -g 200 rain && useradd  -u 200 -g 200 rain

ENTRYPOINT ["/app/start.sh"]